package com.wx.test;

import org.junit.Test;

import java.time.ZoneId;
import java.time.ZonedDateTime;

public class ZonedDateTimeDome {
    @Test
    public void testZoneTime(){
        ZonedDateTime zdt = ZonedDateTime.now();
        System.out.println(zdt);
        ZonedDateTime zdt1 = ZonedDateTime.now(ZoneId.of("America/New_York")); //用指定时区获得当前时间
        System.out.println(zdt1);
    }
}